home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{9F3DA521-3D24-11D2-BB47-0060978DAE40}#1.1#0"; "CIMAGE.DLL"
- Begin VB.Form Form1
- Caption = "CopyImage Demo"
- ClientHeight = 2610
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4110
- LinkTopic = "Form1"
- ScaleHeight = 174
- ScaleMode = 3 'Pixel
- ScaleWidth = 274
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdCopyPicture
- Caption = "CopyPicture Method"
- Height = 495
- Left = 1920
- TabIndex = 2
- Top = 1800
- Width = 1935
- End
- Begin VB.PictureBox Picture1
- AutoSize = -1 'True
- Height = 1305
- Left = 240
- Picture = "cidemo.frx":0000
- ScaleHeight = 1245
- ScaleWidth = 3000
- TabIndex = 1
- Top = 240
- Width = 3060
- End
- Begin VB.CommandButton cmdCopyFile
- Caption = "CopyFile Method"
- Height = 495
- Left = 240
- TabIndex = 0
- Top = 1800
- Width = 1455
- End
- Begin CIMAGELibCtl.CopyImag CopyImag1
- Left = 3600
- OleObjectBlob = "cidemo.frx":451A
- Top = 840
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' CopyImage is a light weight COM-based DLL control that can convert
- ' graphic images to image files (wmf/emf/bmp to gif/bmp). Graphic images
- ' can be resized during the conversion. This allows image resizing
- ' without distortion when converting Metafiles. CopyImage has a file
- ' to file interface and a binary to file interface. From VB you can
- ' create a gif copy of any control's Picture property using the binary
- ' interface. With CopyImage you can create WEB documents on the fly and
- ' create a Gif file that is larger than the screen.
- ' This demo program is a simple example of how to use CopyImage. The program
- ' will show you how to use the CopyFile and CopyPicture methods. Note, the
- ' PictureBox's Picture property can be a *.bmp, *.wmf or a *.emf file.
- ' You can use Microsoft Word to view metafiles and the gif file results.
- ' If you are familiar with our MetaGif product, CopyImage is COM replacement
- ' for MetaGif. MetaGif is a standard DLL library not a COM object. Since
- ' CopyImage is a COM object or ActiveX control, CopyImage has the advantage
- ' of being used in more applications or containers such as VB, Internet
- ' Explorer 4.0 and IIS Active Server Pages. If you want to purchase
- ' CopyImage please see our web site listed below for order information.
- ' The author of this program accepts no responsibility for damages
- ' resulting from the use of this product and makes no warranty or
- ' representation, either express or implied, including but not limited
- ' to, any implied warranty of merchantability or fitness for a particular
- ' purpose. This software is provided "AS IS", and you, its user, assume
- ' all risks when using it.
- ' Author:
- ' David E. Suffield
- ' Eckler Software
- ' dsuffiel@worldaccessnet.com
- ' dsuffiel@hotmail.com
- ' www.worldaccessnet.com/~dsuffiel
- Private Sub cmdCopyFile_Click()
- Dim ep As String
- Dim i As Integer
- Me.MousePointer = vbHourglass
- ep = IIf(Right$(App.Path, 1) <> "\", App.Path + "\", App.Path)
- 'Create gif copies.
- CopyImag1.Type = 1
- Call CopyImag1.CopyFile(ep + "coins.wmf", ep + "coins100.gif", 100, 100)
- Call CopyImag1.CopyFile(ep + "bird.emf", ep + "bird50.gif", 50, 50)
- Call CopyImag1.CopyFile(ep + "eckler.bmp", ep + "eckler100.gif", 100, 100)
- 'Create bmp copies.
- CopyImag1.Type = 2
- Call CopyImag1.CopyFile(ep + "coins.wmf", ep + "coins75.bmp", 75, 75)
- Call CopyImag1.CopyFile(ep + "bird.emf", ep + "bird40.bmp", 40, 40)
- Call CopyImag1.CopyFile(ep + "eckler.bmp", ep + "eckler130.bmp", 130, 130)
- Me.MousePointer = vbDefault
- End Sub
- Private Sub cmdCopyPicture_Click()
- Dim ep As String
- Me.MousePointer = vbHourglass
- ep = IIf(Right$(App.Path, 1) <> "\", App.Path + "\", App.Path)
- 'Create gif copies.
- CopyImag1.Type = 1
- Set Picture1.Picture = LoadPicture(ep + "eckler.bmp")
- Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif100.gif", Picture1.Width, Picture1.Height)
- Set Picture1.Picture = LoadPicture(ep + "coins.wmf")
- Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif60.gif", Picture1.Width * 0.6, Picture1.Height * 0.6)
- Set Picture1.Picture = LoadPicture(ep + "bird.emf")
- Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif40.gif", Picture1.Width * 0.4, Picture1.Height * 0.4)
- 'Create bmp copies.
- CopyImag1.Type = 2
- Set Picture1.Picture = LoadPicture(ep + "eckler.bmp")
- Call CopyImag1.CopyPicture(Picture1.Picture, ep + "bmp120.bmp", Picture1.Width * 1.2, Picture1.Height * 1.2)
- Me.MousePointer = vbDefault
- End Sub
-